Validate string literals#222
Conversation
| "PrefixExpr": (), | ||
| "RangeExpr": (), | ||
| "BinExpr": (), | ||
| "String": (), |
There was a problem hiding this comment.
Is there any way we can avoid the name String here (bikeshed: StringLit, StringExpr etc.)?
There was a problem hiding this comment.
Not sure... The token is called STRING and as far as I know the generator requires that you use the token name in CamelCase. Maybe @matklad knows?
| // the newline, and all whitespace at the beginning of the next line are ignored | ||
| match self.peek() { | ||
| Some('\n') | Some('\r') => { | ||
| self.skip_whitespace(); |
There was a problem hiding this comment.
Am I right in assuming that this will eat the sequence: "\r\n" for windows?
There was a problem hiding this comment.
\n is whitespace playground link, so it should do.
| } | ||
| } | ||
|
|
||
| #[cfg(test)] |
|
Is there any way we can void redefining |
| // the newline, and all whitespace at the beginning of the next line are ignored | ||
| match self.peek() { | ||
| Some('\n') | Some('\r') => { | ||
| self.skip_whitespace(); |
There was a problem hiding this comment.
Should this eat a string of the form
"\
<all whitespace>
more text"where there is an entirely whitespace line. See that \n is whitespace playground link.
The current behaviour appears to be that, unless I'm mistaken.
There was a problem hiding this comment.
It will indeed eat all the whitespace, including new lines, as does the Rust compiler. See this playground link
|
bors r+ |
Build succeeded |
Related: #6 (some validators are still missing), fixes #27